//
//  YQCollectionHeadView.m
//  NewRetail
//
//  Created by yuqin on 2019/7/1.
//  Copyright © 2019 yuqin. All rights reserved.
//

#import "YQCollectionHeadView.h"

@implementation YQCollectionHeadView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupHeadView];
    }
    return self;
}

- (void)setupHeadView {
    [self addSubview:self.backButton];
    [self addSubview:self.theTitleLab];
}

- (UIButton *)backButton {
    if (!_backButton) {
        _backButton = [YQViewFactory buttonWithImage:YQ_IMAGE(@"back") target:self sel:@selector(backAction)];
        _backButton.frame = CGRectMake(0, StatusBarHeight, 44, 44);
    }
    return _backButton;
}

- (UILabel *)theTitleLab {
    if (!_theTitleLab) {
        _theTitleLab = [YQViewFactory labelWithTextColor:WhiteColor textAlignment:NSTextAlignmentCenter fontSize:FIT(18) userBold:NO];
        _theTitleLab.frame = CGRectMake(44, NaviBarHeight+StatusBarHeight-32, ScreenWidth-88, 20);
        _theTitleLab.text = @"收款";
    }
    return _theTitleLab;
}

- (void)backAction {
    if (self.PopBlock) {
        self.PopBlock();
    }
}

@end
